#include "project.h"

project::project()
{
}

physicist project::getParticipant(int id)
{
    for (int i = 0; i<this->participants.length(); i++)
    {
     physicist regardedPhys = this->participants.at(i);
        if( regardedPhys.GetID()==id)
            return regardedPhys;
    }
}

QList<physicist> project::getParticipants()
{
    return participants;
}

bool project::isParticipant(physicist phys)
{
    return getParticipants().contains(phys);
}

void project::removeParticipant(int id)
{
    this->participants.removeAll(getParticipant(id));
}

void project::removeParticipant(physicist remPart)
{
    this->participants.removeAll(remPart);
}

void project::removeParticipant()
{
    this->participants.clear();
}

void project::addParticipant(physicist newparticipant)
{
    this->participants.append(newparticipant);
}

void project::addParticipant(QList<physicist> newparticipants)
{
    foreach (physicist newparticipant, newparticipants)
        this->participants.append(newparticipant);
}
